<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>典当业治安管理信息系统</title>
<link href="../statics/css/style.css" rel="stylesheet" type="text/css" />

<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <link rel="stylesheet" href="${request.contextPath}/statics/css/bootstrap.min.css">
    <link rel="stylesheet" href="${request.contextPath}/statics/css/font-awesome.min.css">
    <link rel="stylesheet" href="${request.contextPath}/statics/css/AdminLTE.min.css">
    <link rel="stylesheet" href="${request.contextPath}/statics/css/all-skins.min.css">
    <link rel="stylesheet" href="${request.contextPath}/statics/css/main.css">
   
    <script src="${request.contextPath}/statics/js/jquery-1.3.1.min.js"></script>
</head>

<body>

  <div class="nrq" id="rrapp" v-cloak>
    <div class="tp"><img src="../statics/images/logo.png"/></div>
    <div class="dlk">
       <form action="" method="get">
        <input type="text" v-model="username" class="wbk1" />
        <input type="password" v-model="password" class="wbk2" id="密码" />
      </form>
      
      <div v-if="error" class="check-error">
          <img src="../../statics/images/login-tip.png" alt="" style="display: inline">&nbsp;&nbsp;{{errorMsg}}
      </div>
      
      <input name="提交" type="submit" @click="login" class="anniu" value="登 录" />
    </div>
  </div>
  
  <div class="footer">版权所有:Copyright shanxi police college all rights reserved
  </div>
  
    <script >

      $(function(){

          $(window).resize(function(){
              $("body").css({ zoom: ($(window).width()/1920)});
          }).resize();

          $(window).keydown(function(e){
//              alert(e.keyCode);
              if ( e.keyCode == 13 )
              $(".anniu").click();
          })
      })
  </script>
  
<!--   <script >

      $(function(){

          $(window).resize(function(){
              $("body").height($(window).height()).width($(window).width());
              $("body > *").css({ zoom: " "+($(window).width()/1920)});

          }).resize();
      })
  </script>
 -->


<script src="${request.contextPath}/statics/libs/jquery.min.js"></script>
<script src="${request.contextPath}/statics/libs/vue.min.js"></script>
<script src="${request.contextPath}/statics/libs/bootstrap.min.js"></script>
<script src="${request.contextPath}/statics/libs/jquery.slimscroll.min.js"></script>
<script src="${request.contextPath}/statics/libs/fastclick.min.js"></script>
<script src="${request.contextPath}/statics/libs/app.js"></script>
<script type="text/javascript">
    var vm = new Vue({
        el: '#rrapp',
        data: {
            username: '',
            password: '',
            captcha: '',
            error: false,
            errorMsg: '',
            src: 'captcha.jpg'
        },
        beforeCreate: function () {
            if (self != top) {
                top.location.href = self.location.href;
            }
        },
        methods: {
            refreshCode: function () {
                this.src = "captcha.jpg?t=" + $.now();
            },
            login: function (event) {
                var data = "username=" + vm.username + "&password=" + vm.password + "&captcha=" + vm.captcha;
                $.ajax({
                    type: "POST",
                    url: "sys/login",
                    data: data,
                    dataType: "json",
                    success: function (result) {
                        if (result.code == 0) {//登录成功
                            parent.location.href = 'index.html';
                        } else {
                            vm.error = true;
                            vm.errorMsg = result.msg;

                            vm.refreshCode();
                        }
                    }
                });
            }
        }
    });
</script>

</body>
</html>
